import { reactive, onMounted, ref } from "vue";
import { getSubjectData } from "@/api/subject/directory";

export const getShowState = (flag) => {
  const state = reactive([
    { label: "显示", value: 1 },
    { label: "隐藏", value: 2 },
  ]);

  if (flag) return Object.assign({ label: "全部", value: 0 }, state);
  else return state;
};

export const getSubjectList = () => {
  const subjectList = ref([]);
  onMounted(async () => {
    const { data } = await getSubjectData();
    subjectList.value = data;
  });
  console.log("xxxxxxxxxxxxxx111");
  console.log("测试vscode git使用");
  console.log("测试vscode git使用111");
  console.log("测试vscode git使用112221");

  return subjectList;
};
